export default {
    data() {
        return {
            countdown: 0,
            countdownTimer: null,
        };
    },
    computed: {},
    methods: {
        // 倒计时
        handleCountdown() {
            this.countdown = 60;
            this.countdownTimer = setInterval((_) => {
                if (this.countdown > 1) {
                    this.countdown--;
                } else {
                    clearInterval(this.countdownTimer);
                    this.countdown = 0;
                    this.countdownTimer = null;
                }
            }, 1000);
        },
    },
};
